#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
using namespace std;

const int N = 2e5 + 10, INF = 0x3f3f3f3f;

int n, m, k, D;
vector<int> g[N];
int f[N][2], d[N][2], pre[N][2];

void solve()
{
    cin >> n >> m >> D;
    for (int i = 0;i <= n;i++) {
        g[i].clear();
        f[i][0] = f[i][1] = -1;
        d[i][0] = d[i][1] = -1;
        pre[i][0] = pre[i][1] = 0;
    }

    for (int i = 1;i <= m;i++) {
        int x, y;cin >> x >> y;
        g[x].push_back(y);
        g[y].push_back(x);
    }

    queue<pair<int, int>> q;
    cin >> k;
    for (int i = 1;i <= k;i++) {
        int x;cin >> x;
        q.push({ x,0 });
        f[x][0] = 0;
    }

    while (!q.empty()) {
        auto [x, t] = q.front();q.pop();
        for (auto y : g[x])
            if (f[y][t ^ 1] == -1 && f[x][t] + 1 <= D) {
                f[y][t ^ 1] = f[x][t] + 1;
                q.push({ y,t ^ 1 });
            }
    }

    q.push({ 1,0 });d[1][0] = 0;
    while (!q.empty()) {
        auto [x, t] = q.front();q.pop();
        for (auto y : g[x]) {
            if (d[y][t ^ 1] != -1) continue;
            if (f[y][t ^ 1] == -1 || d[x][t] + 1 < f[y][t ^ 1]) {
                d[y][t ^ 1] = d[x][t] + 1;
                pre[y][t ^ 1] = x;
                q.push({ y,t ^ 1 });
            }
        }
    }

    int ans = INF, flag;
    if (d[n][0] != -1 && d[n][0] < ans) {
        flag = 0;
        ans = d[n][0];
    }
    if (d[n][1] != -1 && d[n][1] < ans) {
        flag = 1;
        ans = d[n][1];
    }

    if (ans == INF) cout << -1 << '\n';
    else {
        cout << ans << '\n';
        vector<int> path;
        int p = n;
        while (p) {
            if (p == 1 && flag == 0) break;
            path.push_back(p);
            p = pre[p][flag];
            flag ^= 1;
        }
        path.push_back(1);
        reverse(path.begin(), path.end());
        for (auto x : path) cout << x << ' ';
        cout << '\n';
    }
}

signed main()
{
    //ios::sync_with_stdio(0);
    //cin.tie(0);cout.tie(0);
#define ONLINE_JUDGE
#ifndef ONLINE_JUDGE
    std::istringstream in(R"()");
    std::cin.rdbuf(in.rdbuf());
#endif
    int T = 1;
    cin >> T;
    for (int i = 1;i <= T;i++) {
        solve();
    }
}